<?php

namespace App\Models;

use App\Traits\HasDateTimeFormatter;
use App\Traits\HasLoan;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class LoanGeneral extends Model
{
    use HasFactory, HasDateTimeFormatter;

    protected $table = "loan_application";

    const TEMPLATE_HEADER = [
        "apply_at" => "申请时间",
        "name" => "称呼",
        "mobile" => "用户联系电话",
        "custom_field" => "贷款方式",
        "amount" => "贷款额度",
        "need_home_service" => "是否需要上门",
        "addr" => "详细地址",
    ];

    /**
     * @return \Illuminate\Database\Eloquent\Relations\HasOne
     */
    public function loan()
    {
        return $this->hasOne(LoanApplication::class, 'id', 'id');
    }
}
